fetch("assets/row_1.json").then(response => {
    if(response.ok){
        return response.json();
    }
    else {
        console.error(response.status);
    }
    })
    .then(Texts => {
        let Text;
        for (let i = 0; i < Texts.length; i++) {
            div_main = document.getElementById("row_1");

            new_div = document.createElement("div");
            new_div.setAttribute("class","col-sm-6 col-md-4 item")
            div_main.appendChild(new_div);

            image = document.createElement("img");
            image.setAttribute("class","img-fluid");
            new_div.appendChild(image);


            head = document.createElement("h3");
            head.setAttribute("class", "name");
            new_div.appendChild(head);

            content = document.createElement("p");
            content.setAttribute("class", "description");
            new_div.appendChild(content);

            Text = Texts[i];

            image.src = Text.src;
            head.innerHTML = Text.title;
            content.innerHTML = Text.content;
        }
    })
    .catch(error =>{
        console.error(error);
    })

fetch("assets/row_2.json").then(response => {
    if(response.ok){
        return response.json();
    }
    else {
        console.error(response.status);
    }
})
    .then(Texts => {
        let Text;
        for (let i = 0; i < Texts.length; i++) {
            div_main = document.getElementById("row_2");

            new_div = document.createElement("div");
            new_div.setAttribute("class","col-sm-6 col-md-4 item")
            div_main.appendChild(new_div);

            image = document.createElement("img");
            image.setAttribute("class","img-fluid");
            new_div.appendChild(image);


            head = document.createElement("h3");
            head.setAttribute("class", "name");
            new_div.appendChild(head);

            content = document.createElement("p");
            content.setAttribute("class", "description");
            new_div.appendChild(content);

            Text = Texts[i];

            image.src = Text.src;
            head.innerHTML = Text.title;
            content.innerHTML = Text.content;
        }
    })
    .catch(error =>{
        console.error(error);
    })